def clr(dir1):
    list1=[]
    with open(dir1,'r') as f:
        while True:
            url=f.readline()
            if url:
                list1.append(url)
            else:
                break
    list2=list(set(list1))
    list2.sort(key=list1.index)
    list1=list2
    n=len(list1)
    with open(dir1,'w') as f:
        while n:
            #print(list1[0])
            f.write(list1[0])
            n=n-1
            del list1[0]
if __name__ == '__main__':
    clr("m3u8List.txt")